#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<stack>

using namespace std;
//987,654,321
int main()
{
	long long num;
	cin >> num;
	stack<char>st;
	int n = 0;
	while (num) {
		st.push((num % 10)+'0');
		n = (n + 1) % 3;
		num /= 10;
		if (n == 0 && num!=0) {
			st.push(',');
		}
	}
	while (!st.empty()) {
		cout << st.top();
		st.pop();
	}
	return 0;
}